UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tT4ffTk8hk34RZMU4g4oKTIyQzQd3DE1ulaQygydyV0=' 
WHERE 
  key_id = '0a4ccd248ca5dc1c6ac00639063b419702265b7665f731ef89feeabdfa8c8474' 
  AND (
    token = 'tT4ffTk8hk34RZMU4g4oKTIyQzQd3DE1ulaQygydyV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038