UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v3UgX7z+s4igYwemTtJy04fOtyzTsD3aoK3T0fQQNUQ='
WHERE
key_id = '1673774e41a5e0936ad3edb582fa43deb0018b6102acaded0fd64dbeafacc350'
AND (
token = 'v3UgX7z+s4igYwemTtJy04fOtyzTsD3aoK3T0fQQNUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)