UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8vFQ0DtnjXjWWJBJUXeM/Dv9vbb1V5yRvKDsCmxB+g4='
WHERE
key_id = '1eb57126b7179d42f91809d49338b62f8936b0b825c822837e042c611e615f59'
AND (
token = '8vFQ0DtnjXjWWJBJUXeM/Dv9vbb1V5yRvKDsCmxB+g4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)