UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IrOT931lWd/gdBtPy6ftr2jWJNDgnHLwTMOUbspe8vI='
WHERE
key_id = '8614de169bf541e3d17cd40523fd5517d88a4e1f71625be4cd84108b66d3135e'
AND (
token = 'IrOT931lWd/gdBtPy6ftr2jWJNDgnHLwTMOUbspe8vI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)