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