UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M54DbiLibbEWx2j9suJs/PjET9CPXSl03YblMeFI97Q=' 
WHERE 
  key_id = 'b4374ff389b5aa4e367f0c6a5bfa248f71b6ff9d0b19e99393456ab3354aec16' 
  AND (
    token = 'M54DbiLibbEWx2j9suJs/PjET9CPXSl03YblMeFI97Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031