UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cpm7e1uCTISAMRYUNh6u6ytmcZ0Ljjp1kkVjEBjzU64=' 
WHERE 
  key_id = 'd68f9242c189a3570838feca535421dbd26924f43221cbff86f926ae9a596452' 
  AND (
    token = 'cpm7e1uCTISAMRYUNh6u6ytmcZ0Ljjp1kkVjEBjzU64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042