UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3n2r7ekxO0Siu1L5ueFZ6Gt1GHEGsUhteIZ+DcT7XSs='
WHERE
key_id = 'b0beaed96309e2dcb5c13f9c7b2f00f661f3dd98433d45d882805aa9e4fcc30f'
AND (
token = '3n2r7ekxO0Siu1L5ueFZ6Gt1GHEGsUhteIZ+DcT7XSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)