UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7+WPMe5AXeLeCwYU6BgssRnyrsGPcz3TCxQEArronaY='
WHERE
key_id = 'aa5ee1a3187848615e81c0f6049050c88262c269147dfe4d430dabb00f1dfe11'
AND (
token = '7+WPMe5AXeLeCwYU6BgssRnyrsGPcz3TCxQEArronaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)