UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l3jTWrmzUNlnTl+e0o1DlUG5ezQpOG9vhiKGGwzMp1o=' 
WHERE 
  key_id = 'b15b873dfd185de40d4929410582be3018e4efce6b5c66416d6c956485595687' 
  AND (
    token = 'l3jTWrmzUNlnTl+e0o1DlUG5ezQpOG9vhiKGGwzMp1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022