UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IhWYA/n1lQmtFjyLwf5NayytH3vJSR9HmT9JGBPWH74=' 
WHERE 
  key_id = '17b834501cb41bde3db0c3b639480edd053887a4171d371def8d94b880841149' 
  AND (
    token = 'IhWYA/n1lQmtFjyLwf5NayytH3vJSR9HmT9JGBPWH74=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030