UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ODJZhx79pgSS/uoBZ9oZgLYSRGhErwOHjcfbb6GXvzk='
WHERE
key_id = '7d5b5b5d2ca873520912e1421df1253682a64592471f54c81ec1b6c594de452e'
AND (
token = 'ODJZhx79pgSS/uoBZ9oZgLYSRGhErwOHjcfbb6GXvzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)