UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FJ23B41MTtB9Z00Rh7UzUZd4LhRp1S6ro6bu5wr5l1c=' 
WHERE 
  key_id = '050f237e89b2c4ef3d6c2836cba8fd4f3a890d8c878022c520952df659fd1409' 
  AND (
    token = 'FJ23B41MTtB9Z00Rh7UzUZd4LhRp1S6ro6bu5wr5l1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046