UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qkN8SO57jtaZMbWk32qmwmqvfArY1SE6bv5wBCE11o4=' 
WHERE 
  key_id = '724545b226ac3a7365c7a6fdd273a9182fb8f47d7c379404ceca5c4257079dd7' 
  AND (
    token = 'qkN8SO57jtaZMbWk32qmwmqvfArY1SE6bv5wBCE11o4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032