UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JyoJ/3x1rCeHZN7cBxZ6HKvtpqECTpdO7vzIqZ9kQpg=' 
WHERE 
  key_id = '29aa5604491d8470241755dcfe664ed1fe7f97c07cea17e28cd3f37d5fae066f' 
  AND (
    token = 'JyoJ/3x1rCeHZN7cBxZ6HKvtpqECTpdO7vzIqZ9kQpg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036