UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NIx0eEascGPt8GpBur735MRCNX5cKiCLscqIOvMK/fQ=' 
WHERE 
  key_id = '6a417af92112cca886f13329c60b3037747ba259d12f3fc534c5b1900d43a33a' 
  AND (
    token = 'NIx0eEascGPt8GpBur735MRCNX5cKiCLscqIOvMK/fQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055