UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KTJ5/oNPz/+g0TJ8/t4uyNX6/tGznL7Y77AmdDvtijY=' 
WHERE 
  key_id = 'a013a7a008eb98cfbf529194d5e40d42db3b1ea69a3cfc481df7fa21ba35f009' 
  AND (
    token = 'KTJ5/oNPz/+g0TJ8/t4uyNX6/tGznL7Y77AmdDvtijY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031