UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LasJXrvb8WmIAeEkr3JAbg0Un1R/v8Xm0VMM8yqzc9s=' 
WHERE 
  key_id = 'c4f0582ca9034310e063625350eda77b2c756b87adc426bdfae172339ca27db7' 
  AND (
    token = 'LasJXrvb8WmIAeEkr3JAbg0Un1R/v8Xm0VMM8yqzc9s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022