UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't/VPv5RI1sr2vQmnar618i+YuurmVSLirdvScsG599k='
WHERE
key_id = 'c0f5ffa1e088213f8209babd08497b3df5b8031ee410cf233fc1ed17b658a150'
AND (
token = 't/VPv5RI1sr2vQmnar618i+YuurmVSLirdvScsG599k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)