UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l5XwFqyLXcg23aiXQ2fu5f1nrN1i+2k1ahYPfMsivVs=' 
WHERE 
  key_id = '14dff9d38cbadb712d7880b325a2d45cdd9423217a0154c9613cce53ae8bb7ff' 
  AND (
    token = 'l5XwFqyLXcg23aiXQ2fu5f1nrN1i+2k1ahYPfMsivVs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035