UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8RGXI1hX70v+aBApyAMpJN0f7SPBGidyL4M5ZQ8/fVk=' 
WHERE 
  key_id = '2559109c9c35e509884f7ad1103eca9d9810bf85ad40a38960d6a6456298b1d1' 
  AND (
    token = '8RGXI1hX70v+aBApyAMpJN0f7SPBGidyL4M5ZQ8/fVk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041