UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'izQpa+/HcxsSsV7HqAj2vjnv8GsZyk+jVh6QnWwra2w=' 
WHERE 
  key_id = '326a05f4eeed15e14d4354c0f18edddd310f79001331d1a645e43c7c8c99b649' 
  AND (
    token = 'izQpa+/HcxsSsV7HqAj2vjnv8GsZyk+jVh6QnWwra2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038