UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zRfIUi1pTLj0LuCJFU8QJCBjAwIF/9hutvJWA299w+M=' 
WHERE 
  key_id = '8cf19c714fc2ec1d513bdc2fc75b5d9e11e056b41b8fd9c53a518af188d831b2' 
  AND (
    token = 'zRfIUi1pTLj0LuCJFU8QJCBjAwIF/9hutvJWA299w+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051