UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LLeopXFy/wN0P+d6VnP9YA7bh/qPp1lVm/DjT25NYlk='
WHERE
key_id = 'b4cd3faea70d0bbaee952439a01c904ba989a00cdcbb2f25f2b9a7ba65e0e9d2'
AND (
token = 'LLeopXFy/wN0P+d6VnP9YA7bh/qPp1lVm/DjT25NYlk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)