UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vW4kpGULOYvc+Z3HpseQOYi6rOUqZmAUvY9I8nk0cmQ='
WHERE
key_id = '10b528241d4815493ca2bbfefbf8b171d977d7bb13b9b1996ce5a9aaad292d09'
AND (
token = 'vW4kpGULOYvc+Z3HpseQOYi6rOUqZmAUvY9I8nk0cmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)