UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/mPUJgLNA+5l9EyCfRrv07VCyV4BB9CqSrvM8U+dsaQ=' 
WHERE 
  key_id = '3eec1c714bac4b26b63a06c7ad7c474ba22394c2eef43682cf3429de7f3a3b89' 
  AND (
    token = '/mPUJgLNA+5l9EyCfRrv07VCyV4BB9CqSrvM8U+dsaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033