UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HeCogkh7M5hmOYs3lg0Os83v1W6Xx9RFspP/EAi7B7Y=' 
WHERE 
  key_id = '96ab30cffcb0eb90384b068857d3feadf51ff4fe1e23e5dedd93d8e3accded13' 
  AND (
    token = 'HeCogkh7M5hmOYs3lg0Os83v1W6Xx9RFspP/EAi7B7Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024