UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PuH7gn6mdriKDj9FydcfX0ZrsZq8rTYxlI9ytDOqCbo='
WHERE
key_id = 'b8e15a1e0f5ac1874e2f852bdb3d45a7f72b2c6caa657de0ea3e621316677006'
AND (
token = 'PuH7gn6mdriKDj9FydcfX0ZrsZq8rTYxlI9ytDOqCbo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)