UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '24QcacE/jhUbsLo6qrq7gqQjVxWCb/a4cFs7KDQc3J0='
WHERE
key_id = '8dfbf19906bbcdb2bded8ad5c2f22324c77ca37ba44ea719c4a7a884ce9522e3'
AND (
token = '24QcacE/jhUbsLo6qrq7gqQjVxWCb/a4cFs7KDQc3J0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)