UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i/pmqSI5tAGFptAVCBERnFF+u/cEK/WztEuCygk32C8='
WHERE
key_id = 'a755d0c5a63331e6330b2aa5e9ea7f6e8ad8b114f87fd609c795ad663191234e'
AND (
token = 'i/pmqSI5tAGFptAVCBERnFF+u/cEK/WztEuCygk32C8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)