UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lfz6jlWLS7s7EUbiERcxUmC5sE/VgMax5F5orgxl2mE=' 
WHERE 
  key_id = '3bd7baaa08a9f936446bc4c60f4be6477368831f275268dc9f1785f2cdd19e87' 
  AND (
    token = 'Lfz6jlWLS7s7EUbiERcxUmC5sE/VgMax5F5orgxl2mE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048