UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ArSd044OCpathp+3JPppnX2J24kT9OwkmHp2UDvM7gI=' 
WHERE 
  key_id = 'af9e03a74f0af3c35f919b27c523ab95705006d37871645c700f0f5a8aea63a3' 
  AND (
    token = 'ArSd044OCpathp+3JPppnX2J24kT9OwkmHp2UDvM7gI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050