UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bFqeWJ5dX1Mvtz/f38pUsb8ByUTDuBiD9GYvft7aGKs=' 
WHERE 
  key_id = '1bdf939fc6b838421889fbf51e285fe53db8a38fbaeefb2c9d4f52a8f12d5278' 
  AND (
    token = 'bFqeWJ5dX1Mvtz/f38pUsb8ByUTDuBiD9GYvft7aGKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015