UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B5vG6yCnpsjNltbJM47m2nTRMzWwnrH6xE8CwGXOj7U=' 
WHERE 
  key_id = '3e4121f24870b6449ce782e73ee3f6d06aaa59e8553d4fe5d88c341b40a5e313' 
  AND (
    token = 'B5vG6yCnpsjNltbJM47m2nTRMzWwnrH6xE8CwGXOj7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021