UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g1D16s9nbq15KcxRVnMiuWIKvJpQK1Vhu4VtJ+wMmSA='
WHERE
key_id = 'fa1e2b18b720620720afd382ed9aeca068f86fbf91ba5cc2ad5ae3be7ccf196b'
AND (
token = 'g1D16s9nbq15KcxRVnMiuWIKvJpQK1Vhu4VtJ+wMmSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)