UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lhe/4hIbII+WuEA7k0JZyMoZlpX+ZJzbpDCmdS+B7CU=' 
WHERE 
  key_id = '98a60d9d8173fa980bfc5f2a43bea5f1de7f552a38ea994a8e60e32dad9a23cd' 
  AND (
    token = 'lhe/4hIbII+WuEA7k0JZyMoZlpX+ZJzbpDCmdS+B7CU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056