UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2WHa0Bg7/hFSIVZQuUMUWBKS7DYtc6Yqlzsl7sCr62w='
WHERE
key_id = '3417733fe2fc3d8f22c4ef3598179b0accc7e683ae89365464bc0302cc167088'
AND (
token = '2WHa0Bg7/hFSIVZQuUMUWBKS7DYtc6Yqlzsl7sCr62w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)