UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UwdsLO4IEZ6B8k6m4Wyd0NV9sohI4/uVNLrqCWZ7IrY='
WHERE
key_id = 'f5814aecf6cf9e10f363256968a836ad3df726d2f459ff471718c183d45df521'
AND (
token = 'UwdsLO4IEZ6B8k6m4Wyd0NV9sohI4/uVNLrqCWZ7IrY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)