UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5AP0R9124AQWIiSl9VAGDZHnd3BNu0OXs9qUfM205Bw=' 
WHERE 
  key_id = 'a215d64bf6f9fc78ceaf66d62e4ee34591b74db8177e5920e3554e16c26348bd' 
  AND (
    token = '5AP0R9124AQWIiSl9VAGDZHnd3BNu0OXs9qUfM205Bw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015