UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S0uMu5NFNmmnqzSgl+EFgpOEQ1DMmBMFwuEgVsBxTYI=' 
WHERE 
  key_id = '0df4d8bff4325af1a165b1a40a6e4a8f1aeae14af32251454f51c7102cdd3a5f' 
  AND (
    token = 'S0uMu5NFNmmnqzSgl+EFgpOEQ1DMmBMFwuEgVsBxTYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028