UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TkHnPbHZWrJPZGvTZyODFHP923FwU+gwfXukJJID3V4=' 
WHERE 
  key_id = '15a7108977cf0f00f9583573c92ecd7fd25177c7e03503acc1b69854cbb22dfa' 
  AND (
    token = 'TkHnPbHZWrJPZGvTZyODFHP923FwU+gwfXukJJID3V4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034