UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M9Queiy9pFS9BkWl7wlpyb2L4OBJfeY2ZHYuzSaAeGo=' 
WHERE 
  key_id = '2b5aea685860cbe20f1eca5fd2a7ae0c9e29bdc86f7e8348061fa1e9424d10b7' 
  AND (
    token = 'M9Queiy9pFS9BkWl7wlpyb2L4OBJfeY2ZHYuzSaAeGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032