UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Eqi+GRoMduU3sTshvAT2LMiqrBWEo3PXtliBQwv9Avw=' 
WHERE 
  key_id = 'ade45c501f721842e21f32666f1c5c3fd71fea6ae94dacddb4f8f38ae69e8bfc' 
  AND (
    token = 'Eqi+GRoMduU3sTshvAT2LMiqrBWEo3PXtliBQwv9Avw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025