UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vo4LocRP7aochjy4ko6L6J7yWXAWxafGcZCLgGlTU5M='
WHERE
key_id = '0ff90137e7aa0d12a4369b944fb8596154eb2b12f3d9ee1be7db320a13856471'
AND (
token = 'Vo4LocRP7aochjy4ko6L6J7yWXAWxafGcZCLgGlTU5M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)