UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4ji9MvBcwRW7WaMOY9lOqQxA6EMFSqzPbHR0cOuXazM=' 
WHERE 
  key_id = '965dc806d6138053a3d8ac6cc25d2ef8603a8ac4d0f742f5b70b4b9d532c9523' 
  AND (
    token = '4ji9MvBcwRW7WaMOY9lOqQxA6EMFSqzPbHR0cOuXazM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038