UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '40KnRGbyBVxOC4PgTGj66IWIzcYZl4B795pLbN/fVu8='
WHERE
key_id = '447670f2523eec7409004b965bd51a78e7fa753a99f3def35a190cf49d4ab284'
AND (
token = '40KnRGbyBVxOC4PgTGj66IWIzcYZl4B795pLbN/fVu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)