UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mAQlW/kFk736qw1Z5N6LMveiaSUlvwa1vvBcUeuJCfg=' 
WHERE 
  key_id = 'f37b1f49deaa6cfdce080fd6b41b85146e2ec2d661fc73dfd57556e33c309026' 
  AND (
    token = 'mAQlW/kFk736qw1Z5N6LMveiaSUlvwa1vvBcUeuJCfg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064