UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cKmj9Odv+cmGJGHuF9tN0m3tA4XNpoIi/9f8NUJuI/8=' 
WHERE 
  key_id = 'c92b0b50a30433fbfbcf713d447e59360cb32caca41945b7a3c76af297a54808' 
  AND (
    token = 'cKmj9Odv+cmGJGHuF9tN0m3tA4XNpoIi/9f8NUJuI/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031