UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'acKzr+Mm1BuIPhlJiFORV494MG2g3lylKouBpsBd3Ng=' 
WHERE 
  key_id = '007e871efeb890c99cb5203b2a9ea727da13b36880607b8991fe418d28f10f00' 
  AND (
    token = 'acKzr+Mm1BuIPhlJiFORV494MG2g3lylKouBpsBd3Ng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00088