UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HWfBs/Lqs/3pk0WaiTEmkr5hQLckHH/bxrh6fTfBr7M=' 
WHERE 
  key_id = '59f3415e47b776abea7f79409245b5bdbdca1f2d32863cbd51ac57ad91de8bf9' 
  AND (
    token = 'HWfBs/Lqs/3pk0WaiTEmkr5hQLckHH/bxrh6fTfBr7M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032