UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+5MKRqD3u7ej5uOTYCIpVL1tFgfU1ot7u9LdKtSXfgk='
WHERE
key_id = 'eeb46415a54ad89b0e469acc67d113583b570872271f270396826dd9e8f63c19'
AND (
token = '+5MKRqD3u7ej5uOTYCIpVL1tFgfU1ot7u9LdKtSXfgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)