UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wVy1gsGK3Z76GFssYDIgvrWUfUDne1IEPCR/yfU/ts0='
WHERE
key_id = '7216ff07c2405ec86b7fe96f9865353a3ed1f5ed8117e202a45edbeabe016a23'
AND (
token = 'wVy1gsGK3Z76GFssYDIgvrWUfUDne1IEPCR/yfU/ts0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)