UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4JzbAr/zrVkEFPwZYuRtp1KkFRT6XYNrbgfbCrqpU/M=' 
WHERE 
  key_id = 'd85dcc5e32ccc7727ca6608820416650a9aab7472ad61a2686688dcb2617334f' 
  AND (
    token = '4JzbAr/zrVkEFPwZYuRtp1KkFRT6XYNrbgfbCrqpU/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027