UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k0NGiZ5Y196sonhL5SksD8KvofSncYMYYSrMxQa1oBY='
WHERE
key_id = '146082048ed4492a0bb4f2012134b9bf8fa6181ad3ef89fd103853e1affdf04b'
AND (
token = 'k0NGiZ5Y196sonhL5SksD8KvofSncYMYYSrMxQa1oBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)