UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9AcA+MNXWT0fqKxPfgC7D65HR9a2hTvc7lzS+W98JPg='
WHERE
key_id = '7d07ab4340ef29c58b11a9631741b1d68e9c8cd2a8081e2a94751c125a419d73'
AND (
token = '9AcA+MNXWT0fqKxPfgC7D65HR9a2hTvc7lzS+W98JPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)