UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PINRHB7wL2RxzW9pHFdXqNk2S5qvDl3PX9OYJOgkSxU=' 
WHERE 
  key_id = '2a7bf08e22b123ef94dae8af3f6c679df532c9eff99b31ca9a9e23fa6ed182a1' 
  AND (
    token = 'PINRHB7wL2RxzW9pHFdXqNk2S5qvDl3PX9OYJOgkSxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037