UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4BJQtX5C8KDMhE7Bj2RDAUb67UDYYgEpGiIIdFUDU/4=' 
WHERE 
  key_id = '1caed1eb9b5447e382a60e2af588f69219be37eed241d489a0e6546c2759258a' 
  AND (
    token = '4BJQtX5C8KDMhE7Bj2RDAUb67UDYYgEpGiIIdFUDU/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020