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