UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B0UHJOBls2g+xwCrmzKbyKm/HZs2/1+9haff7q4MsyA=' 
WHERE 
  key_id = '6b12e13c8e76d942bd749fa6abef9208d45e3a26b757560dda461c9fc91e7495' 
  AND (
    token = 'B0UHJOBls2g+xwCrmzKbyKm/HZs2/1+9haff7q4MsyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016