UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FxB06LtAhz2tO95h9KDAVd0K+2nbv+U43f+AHjmTqDQ=' 
WHERE 
  key_id = 'c24c2ce60bd08b791939646bdbeb6ea458837190f83a5c92f8f62736c3ca0d2b' 
  AND (
    token = 'FxB06LtAhz2tO95h9KDAVd0K+2nbv+U43f+AHjmTqDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017