UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3WAs82foiT/fVzqIkK5iKw/CeyR3FNtEpF/2lmGRtaE=' 
WHERE 
  key_id = '894c788f74790e20389607e57e7ee5de230c6c9584fad2da99fb9080b1b52a4d' 
  AND (
    token = '3WAs82foiT/fVzqIkK5iKw/CeyR3FNtEpF/2lmGRtaE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031