UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8pGn994xbpUpzWNHtmWZVChXGuKVo3g+yBXhOU+HqQ4='
WHERE
key_id = '53a1980b3f460d3dcfde716a29d2c7d30bac1ea82f87b35a5f6cba53f56fbc45'
AND (
token = '8pGn994xbpUpzWNHtmWZVChXGuKVo3g+yBXhOU+HqQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)