UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9xsBIFdQqXhH0rQkg+HxNSUYrdl75MmoYDax2Ppg+nM=' 
WHERE 
  key_id = '224b274beea747dadb9a368eab82aa9fbd8d045b3b3b1bfd3ddcaf94f518bdae' 
  AND (
    token = '9xsBIFdQqXhH0rQkg+HxNSUYrdl75MmoYDax2Ppg+nM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047