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

Query time 0.00049