UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ut9pWXOM0eL1PuHEVlLHl/v61Vrdiy+sLFwx09JSzQk=' 
WHERE 
  key_id = 'a541ca28e8ea8a3948ba80d52211d6643fa832e3dca7b3ee91c23abc172c4c54' 
  AND (
    token = 'ut9pWXOM0eL1PuHEVlLHl/v61Vrdiy+sLFwx09JSzQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036