UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qI/hUaDv436ZsOYxk++FRrq6Z4BtSdCIgyZe94UZagM='
WHERE
key_id = 'c48cc6bfc042d8c8540dc57f95a4a14be1812218c060870fd03ee9aa6f43784b'
AND (
token = 'qI/hUaDv436ZsOYxk++FRrq6Z4BtSdCIgyZe94UZagM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)