UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l7WZyXg/9yUY8fEL8IYg438UvgA8En9sYwDe3s79jUk='
WHERE
key_id = 'a0a9b1bbc8b9194024a76912a1df4bc0b195848fc408e5eef2aef29475c84a06'
AND (
token = 'l7WZyXg/9yUY8fEL8IYg438UvgA8En9sYwDe3s79jUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)